<template>
	<view class="content">
		<image @click="onClick" class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<view class="text-area">
			<text class="title">APP-Vue2</text>
		</view>
		<view @click="onJump" class="text-area bnt" >
			<button class="title">调用</button>
		</view>
		<view @click="getApi" class="text-area bnt" >
			<button class="title">发送请求</button>
		</view>
		<view @click="log" class="text-area bnt" >
			<button class="title">日志输出</button>
		</view>
		<view @click="err" class="text-area bnt" >
			<button class="title">错误输出</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {
			// this.getApi()
		},
		methods: {
			onClick(){
				uni.navigateTo({
					url:"/pages/index/index-n2"
				})
			},
			getApi(){
				uni.request({
					url:"http://www.baidu.com/wechat_shop_active/hot_key",
					data:{"test":"ttttt","test2":"ttttt"},
					method:"POST",
					success(res) {
						console.log("res",res)
					}
				})
				uni.request({
					url:"http://www.baidu.cn/wechat_shop_active/1",
					data:{"test":"ttttt"},
					method:"POST",
					success(res) {
						console.log("res",res)
					}
				})
			},
			onJump(){
				console.log("onJump-EEE",getApp().globalData)
				uni.navigateTo({
					url: "/uni_modules/HF-HF_debugging/pages/next/next",
					animationType: "slide-in-bottom"
				})
			},
			log(){
				console.log("日志输出")
			},
			err(){
				try{
					a()
				}catch(e){
					console.error(e)
				}
			}
		}
	}
</script>

<style>
	.bnt{
		width: 200rpx;
		height: 80rpx;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
